#ifndef LCD_H
#define LCD_H

#include <inttypes.h>
#include <Print.h>

#define LCD_BACKLIGHT_BASE 128
#define LCD_BACKLIGHT_OFF 0
#define LCD_BACKLIGHT_25 7
#define LCD_BACKLIGHT_50 15
#define LCD_BACKLIGHT_75 22
#define LCD_BACKLIGHT_ON 29

class LCD : public Print {
  private:
    Print *serial;
    virtual void write(uint8_t b);
  public:
    explicit LCD(Print *serial);
    void setBrightness(int brightness);
    void setSplashScreen(const char *line1, const char *line2);
    void setSplashScreen();
    void toggleSplashScreen();
    void clearDisplay();
    void cursorRight(const int distance);
    void cursorLeft(const int distance);
    void scrollRight(const int distance);
    void scrollLeft(const int distance);
    void visualDisplayOn();
    void visualDisplayOff();
    void underlineCursorOn();
    void underlineCursorOff();
    void blinkingCursonOn();
    void blinkingCursorOff();
    void setCursorPosition(const uint8_t position);
    void setCursorLine1();
    void setCursorLine2();
    void printLine1(const char *line);
    void printLine2(const char *line);
    void sendConfigCommand();
    void sendConfigCommand(const uint8_t command);
    void sendDisplayCommand();
    void sendDisplayCommand(const uint8_t command);
};

#endif
